<?php if (!defined('THINK_PATH')) exit();?><form id="pagerForm" action="/Admin/Advers/index" method="post">
    <input type="hidden" name="pageNum" value="<?php echo ($page['pageNum']); ?>"/>
<input type="hidden" name="numPerPage" value="<?php echo ($page['numPerPage']); ?>" />
    <input type="hidden" name="pid" value="<?php echo ($search['pid']); ?>" />
    <input type="hidden" name="pidSort" value="<?php echo ($search['pidSort']); ?>" />
</form>
<style>tr td,th{text-align:center}.typestyle{padding: 2px 6px;font-size: 13px;color: #fff;border-radius: 4px;}</style>
<script type="text/javascript" src="/Public/Admin/Js/twoLinkage.js"></script>
<script type="text/javascript">
$( function() {
	var parentObj = $('select[name="pidSort"]');
        var subObj = $('select[name="secondpid"]');
	$.twoLinkage( parentObj, subObj );
        
        var parentObj = $('select[name="secondpid"]');
        var subObj = $('select[name="pid"]');
	$.twoLinkage( parentObj, subObj );
} );
</script>
<div class="pageHeader">
    <form onsubmit="return navTabSearch(this);" action="/Admin/Advers/index" method="post">
    <div class="searchBar">
        <ul class="searchContent">
			<li>广告名称：<input type="text" name="adname" value="<?php echo ($search['adname']); ?>" /></li>
            <li>
                <label>类型：</label>
                <select name="type" class="required">
                    <option value="0">请选择</option>
                    <option value="2" <?php if(2 == $search['type']): ?>selected = "selected"<?php endif; ?> >社会责任</option>
					<option value="3" <?php if(3 == $search['type']): ?>selected = "selected"<?php endif; ?> >员工风采</option>
                </select>
			</li>
			<li>
                <label>是否显示：</label>			
                <select name="is_show" class="required">
                    <option value="">请选择</option>
                    <option value="1" <?php if(1 == $search['is_show']): ?>selected = "selected"<?php endif; ?> >显示</option>
					<option value="2" <?php if(2 == $search['is_show']): ?>selected = "selected"<?php endif; ?> >隐藏</option>
                </select>
			</li>
        </ul>
        <div class="subBar">
            <ul>
                <li><div class="buttonActive"><div class="buttonContent"><button type="submit">查询</button></div></div></li>
            </ul>
        </div>
    </div>
    </form>
</div>

<div class="pageContent">
    <div class="panelBar">
        <ul class="toolBar">
            <li>
                <a href="/Admin/Advers/add" class="add" rel="add" target="dialog"  title="添加">
                    <span>添加</span>
                </a>
            </li>      
			<li class="line">line</li>
			<li>
                <a class="audit" href="/Admin/Advers/check/status/yes" target="selectedTodo" rel="id" posttype="string" title="你确定要批量审核显示吗？">
                	<i class="iconfont">&#xe62c;</i>
                    <span>显示</span>
                </a>
            </li>
			<li class="line">line</li>
			<li>
                <a class="edit" href="/Admin/Advers/check/status/no" target="selectedTodo" rel="id" posttype="string" title="你确定要批量审核隐藏吗？">
                	<i class="iconfont">&#xe62c;</i>
                    <span>隐藏</span>
                </a>
            </li>
			<li class="line">line</li>
            <li>
                <a class="delete" href="/Admin/Advers/remove" target="selectedTodo" rel="id" posttype="string" title="你确定要批量删除吗？">
                    <span>删除</span>
                </a>
            </li>
        </ul>
    </div>
    <table class="table" width="100%" layoutH="206">
        <thead>
        <tr>
            <th width="2%"><input type="checkbox" group="id" class="checkboxCtrl" ></th>
            <th width="3%">编号</th>
            <th width="10%">图片名称</th>
            <th width="16%">缩略图</th>
            <th width="10%">广告类型</th>
			<th width="10%">跳转地址</th>  
			<th width="10%">排序</th>
			<th width="10%">是否显示</th>
            <th width="10%">创建时间</th>
            <th width="5%">操作</th>
        </tr>
        </thead>
        <tbody>
        <?php if($dataList|count > 0): if(is_array($dataList)): $k = 0; $__LIST__ = $dataList;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$volist): $mod = ($k % 2 );++$k;?><tr target="sid_user" rel="<?php echo ($volist['id']); ?>" >
                    <td><input name="id" value="<?php echo ($volist['id']); ?>" type="checkbox"></td>
                    <td><?php echo ( $page['pageNum'] - 1 ) * $page['numPerPage'] + $k;?></td>
                    <td><?php echo ($volist['name']); ?></td>
					<td>
                        <?php if($volist['img_url'] == ''): ?><img src="/Public/Admin/Images/nopic.jpg" height="70" width="100" alt="" />
                            <?php else: ?>
                            <a href="<?php echo ($volist['img_url']); ?>" title="<?php echo ($volist['img_url']); ?>" target="_blank" rel="example_group">
                                <img src="<?php echo ($volist['img_url']); ?>" height="70" width="100" alt="<?php echo ($volist['img_url']); ?>" />
                            </a><?php endif; ?>
                    </td>
					<td>
						<?php if($volist['type'] == 2): ?><span class="typestyle" style="line-height:60px;background-color:#8B7500;">社会责任</span>
	                    <?php else: ?>
	                    	<span class="typestyle" style="line-height:60px;background-color:#5F9EA0;">员工风采</span><?php endif; ?>
					</td>
					<td><?php echo ($volist['url']); ?></td>
					<td><?php echo ($volist['sort']); ?></td>
					<td>
						<?php if($volist['is_show'] == 0): ?><span class="typestyle" style="line-height:60px;background-color:#90EE90;">显示</span>
	                    <?php else: ?>
	                    	<span class="typestyle" style="line-height:60px;background-color:#EE3B3B;">隐藏</span><?php endif; ?>
					</td>
                    <td><?php echo ($volist['addtime']); ?></td>
					<td>【<a href="/Admin/Advers/edit/id/<?php echo ($volist['id']); ?>" class="edit" style="color: #09F" target="dialog" rel="edit" >编辑</a>】</td>
                </tr><?php endforeach; endif; else: echo "" ;endif; ?>
        <?php else: ?>
        	<tr><td colspan="10" style="text-align:center;">没有数据!!!</td></tr><?php endif; ?>
        </tbody>
    </table>
    <div class="panelBar" style="background:none;">
    <div class="pages">
        <span>显示</span>
        <select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})">
            <?php if(is_array($page['numPerPageArray'])): foreach($page['numPerPageArray'] as $key=>$vo): ?><option value="<?php echo ($vo); ?>"<?php if($vo == $page['numPerPage']): ?>selected='selected'<?php endif; ?>><?php echo ($vo); ?></option><?php endforeach; endif; ?>
        </select>
        <span>条，共<?php echo ($page['all']); ?>条</span>
    </div>
    <div class="pagination" targetType="navTab" totalCount="<?php echo ($page['all']); ?>" numPerPage="<?php echo ($page['numPerPage']); ?>" pageNumShown="10" currentPage="<?php echo ($page['pageNum']); ?>"></div>
</div>
</div>